package com.xinghou.platform.dao.main.impl;


import java.sql.ResultSet;
import java.sql.SQLException;

import javax.annotation.Resource;

import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Service;

import com.xinghou.platform.dao.bases.JdbcTemplate;
import com.xinghou.platform.dao.bases.database.CustomerContextHolder;
import com.xinghou.platform.dao.main.StoreTypeDAO;
import com.xinghou.platform.model.main.StoreType;

/**
 * @author liuwei.wen
 *
 */
@Service
public class StoreTypeDAOImpl {

	/*@Resource
	private JdbcTemplate jdbcTemplate;

	@Override
	public StoreType getStoreTypename(Integer typeId) {
		CustomerContextHolder.setCustomerType(CustomerContextHolder.DATA_SOURCE_READ);
		String sql="SELECT 	NAME FROM store_type  where Type_id = ?";
		StoreType storeType = jdbcTemplate.queryForObject(sql, new Object[] {typeId}, new StoreTypeMapper());
		CustomerContextHolder.clearCustomerType();
		return storeType;
	}

	private static final class StoreTypeMapper implements RowMapper<StoreType> {
		public StoreType mapRow(ResultSet rs, int rowNum) throws SQLException {
			StoreType storeType = new StoreType();
			storeType.setName(rs.getString("NAME"));
			return storeType;
		}
	}*/

}
